package com.tengju.support.domain.model.resource;


import lombok.AllArgsConstructor;

@AllArgsConstructor
public enum JumpAction {

    /**
     * WebView
     */
    WEB_VIEW(1,"WebView"),
    /**
     * 原生
     */
    ORIGINAL(2,"原生");

    private Integer val;
    private String desc;

    public Integer getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    public static JumpAction fromVal(Integer val) {
        for (JumpAction type : values()) {
            if (type.val.equals(val)) {
                return type;
            }
        }
        return null;
    }

    public static JumpAction fromName(String name) {
        for (JumpAction type : values()) {
            if (type.name().equals(name)) {
                return type;
            }
        }
        return null;
    }

}
